package com.sxj.PDMS.mapper;

import com.sxj.PDMS.model.entity.YusIncompleteRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 503c'j
* @description 针对表【yus_incomplete_record(青年大学习未完成记录表)】的数据库操作Mapper
* @createDate 2024-06-18 16:45:09
* @Entity com.sxj.PDMS.model.entity.YusIncompleteRecord
*/
public interface YusIncompleteRecordMapper extends BaseMapper<YusIncompleteRecord> {

    List<YusIncompleteRecord> selectByNameOrGradeOrStudentNumber(@Param("start") Integer start,
                                                                 @Param("pageSize") Integer pageSize,
                                                                 @Param("name") String name,
                                                                 @Param("grade") String grade,
                                                                 @Param("studentNumber") String studentNumber);

    Long selectTotalByNameOrGradeOrStudentNumber(@Param("name") String name,
                                                 @Param("grade") String grade,
                                                 @Param("studentNumber") String studentNumber);

    /**
     * 查询所有数据,分页展示
     *
     * @param start
     * @param pageSize
     * @return
     */
    @Select("select * from yus_incomplete_record limit #{start},#{pageSize}")
    List<YusIncompleteRecord> selectAll(@Param("start") Integer start,
                                        @Param("pageSize") Integer pageSize);

    @Select("select count(*) from yus_incomplete_record")
    Long selectTotal();

    List<YusIncompleteRecord> selectAllStudentAndDownload(@Param("name") String name,
                                                          @Param("grade") String grade,
                                                          @Param("studentNumber") String studentNumber);
}




